//////////////////////////////////////////////////////////////////////////////////
//
//	avamods hill sniper limit
//		- Version 1.2
//		- 04.14.2008
//		- diamond-optic
//
//////////////////////////////////////////////////////////////////////////////////
//
// Information:
//
// - Progressive sniper limits once used on the avamods server (no longer used!)
//
//////////////////////////////////////////////////////////////////////////////////
//
// Changelog:
//
// - 11.02.2006 Version 1.1
//	Initial Release
//
// - 11.02.2006 Version 1.2
//	Updated public cvar format
//	Various code improvements
//
//////////////////////////////////////////////////////////////////////////////////


#include <amxmodx>

#define VERSION "1.2"
#define SVERSION "v1.2 - by diamond-optic (www.AvaMods.com)"

new mapname[32]

public plugin_init() 
{
	register_plugin("avamods hill sniper limit",VERSION,"diamond-optic")
	register_cvar("avamods_hill_sniperlimit_stats",SVERSION,FCVAR_SERVER|FCVAR_SPONLY)
}

public plugin_precache()
	get_mapname(mapname,31)
	
public client_putinserver(id)
	check_count()
	
public client_disconnect(id)
	check_count()
	
public check_count()
{
	if(equali(mapname,"dod_hill_classic"))
		{
		new players_on = get_playersnum()
	
		if(players_on < 8)
			server_cmd("mp_limitaxisscopedkar 1; mp_limitalliesspring 1")
		else if(players_on > 7 && players_on < 12)
			server_cmd("mp_limitaxisscopedkar 2; mp_limitalliesspring 2")
		else if(players_on > 11)
			server_cmd("mp_limitaxisscopedkar 3; mp_limitalliesspring 3")
		}	
}